<%@page import="java.util.ArrayList"%>
<%@page import="java.util.Collections"%>
<%@page import="javax.cache.CacheException"%>
<%@page import="javax.cache.CacheManager"%>
<%@page import="javax.cache.Cache"%>
<%@page import="java.util.List"%>
<%@page import="articles.model.Articles"%>
<%@page import="javax.jdo.Query"%>
<%@page import="articles.data.QnAPersistenceManager"%>
<%@page import="javax.jdo.PersistenceManager"%>
<%@page import="articles.string.Replace"%>
<%
Cache cache=null;

try {
    cache = CacheManager.getInstance().getCacheFactory().createCache(Collections.emptyMap());
} catch (CacheException e) {
   e.printStackTrace();
   
}
%>

<div class="simple-box"  itemscope itemtype="http://schema.org/ItemList">
	<h3 itemprop="name">Recent Articles View</h3>
	<meta itemprop="itemListOrder" content="Descending" />
    <div class="content-box">
    	<div class="article-listing">
            <ul>
            	<%
          			if(cache!=null&&cache.containsKey("lastPing"))
  					{
          				ArrayList<String[]> lastView = (ArrayList<String[]>)cache.get("lastPing");
  						for(String[] bisiness : lastView) 
					{
          			%>
					<li itemprop="itemListElement" itemscope itemtype="http://schema.org/Article">
						<h4 itemprop="name"><a href="/article/<%=bisiness[1] %>" title="Article <%=Replace.remove(bisiness[0]) %>" itemprop="url"><%=bisiness[0] %></a></h4>
						<p>Author : <span class="author" itemprop="author"><a href="/author/<%=bisiness[4] %>"  title="Author <%=Replace.remove(bisiness[2]) %>" itemprop="url"><%=bisiness[2] %></a></span> | 
						Date : <time datetime="<%=bisiness[3] %>"><a href="/date/<%=bisiness[5] %>"  title="Date <%=bisiness[3] %> %>" itemprop="url"><%=bisiness[3] %></a></time></p>
					</li>
					<%
					}
  					}
          			%>
            </ul>
        </div>
    </div>
</div>